package base

import (
	"gopkg.in/gin-gonic/gin.v1"
)

type Resp struct {
	Version string
}

func (r *Resp) Success(c *gin.Context, message string, data interface{}) {
	c.JSON(200, gin.H{
		"status":     0,
		"statusCode": message,
		"data":       data,
		"version":    r.Version,
	})
}

func (r *Resp) Fail(c *gin.Context, message string, data interface{}) {
	c.JSON(200, gin.H{
		"status":     1,
		"statusCode": message,
		"data":       data,
		"version":    r.Version,
	})
}
